package jh.com.jhappbf.unload;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import androidx.fragment.app.Fragment;
import jh.com.jhappbf.R;

/**
 * @author Administrator
 */
public class UnloadManager extends Fragment implements OnClickListener {

    private ImageView mAddUnloadImg;
    private ImageView mQueryUnloadImg;
    private RelativeLayout buyLayout;
    private RelativeLayout saleLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.unload_main_activity, null);
        initView(v);
        return v;
    }

    /**
     * 初始化控件
     */
    private void initView(View v) {
        buyLayout=v.findViewById(R.id.unload_add_layout);
        saleLayout=v.findViewById(R.id.unload_query_layout);
        mAddUnloadImg = v.findViewById(R.id.unload_add_img);
        mQueryUnloadImg = v.findViewById(R.id.unload_query_img);
        mAddUnloadImg.setOnClickListener(this);
        mQueryUnloadImg.setOnClickListener(this);
        buyLayout.setOnClickListener(this);
        saleLayout.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //采购确认
            case R.id.unload_add_img:
            case R.id.unload_add_layout:
         //       Intent i = new Intent(getActivity(), SaleStateQuery.class);
                Intent i = new Intent(getActivity(), ComfirmhListView.class);
                getActivity().startActivity(i);
                break;
            //销售确认
            case R.id.unload_query_img:
            case R.id.unload_query_layout:
                Intent i1 = new Intent(getActivity(), UnloadQuery.class);
//                Intent i1 = new Intent(getActivity(), SaleConfirm.class);
                getActivity().startActivity(i1);
                break;
            default:
                break;
        }
    }
}


